<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ include file="/parameter.jsp"%>
<%@page isELIgnored="false"%>
<!DOCTYPE>
<html>
<head>
<TITLE>论坛</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
	<Meta http-equiv="Pragma" Content="No-cach">
		<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
			<META HTTP-EQUIV="Expires" CONTENT="0">

				<link href="style/style.css" rel="stylesheet" type="text/css" /><script language="javascript">
					function toSubmit() {
						debugger;
						if (document.userInfoForm.password.value != document.userInfoForm.repwd.value) {
							alert("您输入的新密码不一致！请重新输入！");
							document.userInfoForm.password.value = "";
							document.userInfoForm.repwd.value = "";
							//document.userInfoForm.password.focus();
						} else {
							return userInfoForm.submit();
						}
					}
				</script>

</HEAD>
<body>
	<jsp:include page="inc/header.jsp" />
	<header class="entry-header">
		<h1 class="entry-title">
			<span>修改密码
				<div id="searchbar">
					<form name="form3" method="post"
						action="commonAction.do?method=SearchTopic">
						<input type="text" id="keywords" name="keywords" title="搜索">
						<button onClick="search();">搜索</button>
					</form>
				</div> </span>
		</h1>
	</header>

	<div id="maindiv">
		<div id="nav">
			<c:choose>
				<c:when test="${sessionScope.user == null}">
					<div>
						<form name="form1" method="post"
							action="commonAction.do?method=UserLogin">
							账号：<input type="text" name="username"> 密码：<input
								type="password" name="password">
							<button onClick="loginsubmit();">登陆</button>
							<a href="commonAction.do?method=toRegister">注册新账号</a>
						</form>
					</div>
				</c:when>
				<c:otherwise>
					<div>
						&nbsp;&nbsp;<c:choose><c:when test="${sessionScope.user.nickname != ''}">${sessionScope.user.nickname}</c:when><c:otherwise>${sessionScope.user.username}</c:otherwise></c:choose>d&nbsp;你好！<a
							href="commonAction.do?method=Logout">注销</a>&nbsp;|&nbsp;<a
							href="commonAction.do?method=EditUserInfo&uid=${sessionScope.user.id}">修改个人信息</a>&nbsp;|&nbsp;<a
							href="commonAction.do?method=EditUserPwd&uid=${sessionScope.user.id}">修改密码</a>
					</div>
				</c:otherwise>
			</c:choose>
			<a href="./" title="首页">首页</a> <span>&gt;</span> <a href="###">修改密码</a>
		</div>

		<div id="board">
			<div class="bm">
				<div id="post_r">
					<div class="bm_h">
						<h2>修改密码</h2>
					</div>
					<div class="replay_b">
                    <div class="msg">
                        <!--<span class="message cl">&#8226;&nbsp;提示消息样式</span>-->
                        <c:if test="${info != null && info != ''}"><span class="error cl">&#8226;&nbsp;${info}</span></c:if>
                    </div>
						<form name="userInfoForm" method="post" action="commonAction.do?method=EditUserPwdSubmit">
							<input type="hidden" name="uid" value="${sessionScope.user.id}" />
							<div class="frm_row">
								<label>用 户 名: </label>${UserInfo.username}
							</div>
							<div class="frm_row">
								<label>原 密 码: </label><input type="password" name="oldpassword"
									size="20" maxlength="20" value="" title="请输入原密码！" /> *请输入原密码！
							</div>
							<div class="frm_row">
								<label>新 密 码: </label><input type="password" name="password"
									size="20" maxlength="20" value="" title="请输入新密码！" />
								*英文字母或数字等不少于6位
							</div>
							<div class="frm_row">
								<label>确认密码: </label><input type="password" name="repwd"
									size="20" maxlength="20" value="" title="请确认新密码！">
								*英文字母或数字等不少于6位
							</div>
						</form>
							<div class="frm_row">
								<button onClick="toSubmit()">提交</button>
							</div>
					</div>
				</div>
			</div>
		</div>

	</div>

	<jsp:include page="inc/footer.jsp" />
</body>
</HTML>